Economic events
DXcharts supports multiple types of business-related events, displayed along the chart's X-axis.
Supported event types include:
- Earnings
- Dividends
- Splits
- Conference calls
Use the Events component API (available via chart.events
) to display and configure event markers on the chart.
Adding events
Use chart.events.setEvents
to add events to the chart:
Visibility
Use chart.events.setVisible
to change visibility.
Interaction
You can subscribe to hover events using chart.events.observeEventHovered
:
Customizing appearance
Event icons
You can override event icons using the chart.config.components.events.icons
configuration.
Each event type has two icon states: normal and hover. Be sure to define both if overriding.
Custom icon example
Label formatting
To customize event labels, set a formatter in the configuration:
After applying a formatter, events will display the updated labels: